<template>
  <div class="graph-stencil">
    <h3>基本图形</h3>
    <div class="shapes">
      <div class="base circle" @mousedown="startDrag('Figure1', $event)">可编辑</div>
      <div class="base circle" @mousedown="startDrag('Figure2', $event)">圆</div>
      <div class="base" @mousedown="startDrag('Figure3', $event)">过程</div>
      <div class="base radius" @mousedown="startDrag('Figure4', $event)">矩形</div>
      <div class="base" @mousedown="startDrag('Figure5', $event)">可编辑</div>
    </div>
  </div>
</template>
<script setup>
import { GraphRegister, graphList } from '../data';
const emit = defineEmits(['onStartDrag']);
graphList.forEach((item) => {
  GraphRegister(item);
});
const startDrag = (shape, e) => emit('onStartDrag', shape, e);
</script>
<style lang="scss" scoped>
.graph-stencil {
  padding: 0 10px;
  h3 {
    padding: 10px 0;
  }
  .shapes {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .base {
    cursor: pointer;
    margin-bottom: 10px;
    width: 60px;
    height: 30px;
    line-height: 30px;
    border: 1px solid dimgray;
    text-align: center;
  }
  .circle {
    height: 60px;
    line-height: 60px;
    border-radius: 50%;
  }
  .radius {
    border-radius: 10px;
  }
}
</style>
